﻿using System;
using System.Collections.Generic;
using UFIDA.U9.CBO.Pub.Controller;
using UFIDA.U9.ISV.PUB.RestSV.Common;
using UFIDA.U9.ISV.PUB.RestSV.Model.Pub;
using UFIDA.U9.ISV.SM;

namespace JGSoft.U9CRTAPIEX.DTOs.RequestDTOs
{
	// Token: 0x0200001C RID: 28
	public class ShipRData
	{
		/// <summary>
		/// ID (该属性不可为空,且无默认值)
		/// </summary>
		// Token: 0x17000116 RID: 278
		// (get) Token: 0x0600024F RID: 591 RVA: 0x00004762 File Offset: 0x00002962
		// (set) Token: 0x06000250 RID: 592 RVA: 0x0000476A File Offset: 0x0000296A
		public long ID { get; set; }

		/// <summary>
		/// OtherID 
		/// 第三方传入ID
		/// </summary>
		// Token: 0x17000117 RID: 279
		// (get) Token: 0x06000251 RID: 593 RVA: 0x00004773 File Offset: 0x00002973
		// (set) Token: 0x06000252 RID: 594 RVA: 0x0000477B File Offset: 0x0000297B
		public string OtherID { get; set; }

		/// <summary>
		/// 单据号 (该属性不可为空,且无默认值)
		/// </summary>
		// Token: 0x17000118 RID: 280
		// (get) Token: 0x06000253 RID: 595 RVA: 0x00004784 File Offset: 0x00002984
		// (set) Token: 0x06000254 RID: 596 RVA: 0x0000478C File Offset: 0x0000298C
		public string DocNo { get; set; }

		/// <summary>
		/// 业务日期 (该属性不可为空,但有默认值)
		/// </summary>
		// Token: 0x17000119 RID: 281
		// (get) Token: 0x06000255 RID: 597 RVA: 0x00004795 File Offset: 0x00002995
		// (set) Token: 0x06000256 RID: 598 RVA: 0x0000479D File Offset: 0x0000299D
		public DateTime BusinessDate { get; set; }

		/// <summary>
		/// 描述性弹性域 (该属性可为空,且无默认值)
		/// </summary>
		// Token: 0x1700011A RID: 282
		// (get) Token: 0x06000257 RID: 599 RVA: 0x000047A6 File Offset: 0x000029A6
		// (set) Token: 0x06000258 RID: 600 RVA: 0x000047AE File Offset: 0x000029AE
		public DescFlexFieldRData DescFlexField { get; set; }

		/// <summary>
		/// 客户ID (该属性不可为空,且无默认值)
		/// </summary>
		// Token: 0x1700011B RID: 283
		// (get) Token: 0x06000259 RID: 601 RVA: 0x000047B7 File Offset: 0x000029B7
		// (set) Token: 0x0600025A RID: 602 RVA: 0x000047BF File Offset: 0x000029BF
		public long CustomerKey { get; set; }

		/// <summary>
		/// 客户Code (该属性不可为空,且无默认值)
		/// </summary>
		// Token: 0x1700011C RID: 284
		// (get) Token: 0x0600025B RID: 603 RVA: 0x000047C8 File Offset: 0x000029C8
		// (set) Token: 0x0600025C RID: 604 RVA: 0x000047D0 File Offset: 0x000029D0
		public string CustomerCode { get; set; }

		/// <summary>
		/// 单据类型ID (该属性不可为空,且无默认值)
		/// </summary>
		// Token: 0x1700011D RID: 285
		// (get) Token: 0x0600025D RID: 605 RVA: 0x000047D9 File Offset: 0x000029D9
		// (set) Token: 0x0600025E RID: 606 RVA: 0x000047E1 File Offset: 0x000029E1
		public long DocTypeKey { get; set; }

		/// <summary>
		/// 单据类型Code (该属性不可为空,且无默认值)
		/// </summary>
		// Token: 0x1700011E RID: 286
		// (get) Token: 0x0600025F RID: 607 RVA: 0x000047EA File Offset: 0x000029EA
		// (set) Token: 0x06000260 RID: 608 RVA: 0x000047F2 File Offset: 0x000029F2
		public string DocTypeCode { get; set; }

		/// <summary>
		/// 业务员Code(该属性不可为空,且无默认值)
		/// </summary>
		// Token: 0x1700011F RID: 287
		// (get) Token: 0x06000261 RID: 609 RVA: 0x000047FB File Offset: 0x000029FB
		// (set) Token: 0x06000262 RID: 610 RVA: 0x00004803 File Offset: 0x00002A03
		public string SellerCode { get; set; }

		/// <summary>
		/// 部门Code(该属性不可为空,且无默认值)
		/// </summary>
		// Token: 0x17000120 RID: 288
		// (get) Token: 0x06000263 RID: 611 RVA: 0x0000480C File Offset: 0x00002A0C
		// (set) Token: 0x06000264 RID: 612 RVA: 0x00004814 File Offset: 0x00002A14
		public string SaleDeptCode { get; set; }

		/// <summary>
		/// 立账条件Code(该属性可为空,且无默认值)
		/// </summary>
		// Token: 0x17000121 RID: 289
		// (get) Token: 0x06000265 RID: 613 RVA: 0x0000481D File Offset: 0x00002A1D
		// (set) Token: 0x06000266 RID: 614 RVA: 0x00004825 File Offset: 0x00002A25
		public string ConfirmTermCode { get; set; }

		/// <summary>
		/// 变化字段清单 (该属性可为空,但有默认值)
		/// </summary>
		// Token: 0x17000122 RID: 290
		// (get) Token: 0x06000267 RID: 615 RVA: 0x0000482E File Offset: 0x00002A2E
		// (set) Token: 0x06000268 RID: 616 RVA: 0x00004836 File Offset: 0x00002A36
		public List<string> ChangeFieldList { get; set; }

		/// <summary>
		/// 交易币编码 (该属性可为空,且无默认值)
		/// </summary>
		// Token: 0x17000123 RID: 291
		// (get) Token: 0x06000269 RID: 617 RVA: 0x0000483F File Offset: 0x00002A3F
		// (set) Token: 0x0600026A RID: 618 RVA: 0x00004847 File Offset: 0x00002A47
		public string TC { get; set; }

		/// <summary>
		/// 核币编码 (该属性可为空,且无默认值)
		/// </summary>
		// Token: 0x17000124 RID: 292
		// (get) Token: 0x0600026B RID: 619 RVA: 0x00004850 File Offset: 0x00002A50
		// (set) Token: 0x0600026C RID: 620 RVA: 0x00004858 File Offset: 0x00002A58
		public string AC { get; set; }

		/// <summary>
		/// 汇率类型 (该属性可为空,但有默认值)买入 Value:0 ;卖出 Value:1;中间价 Value:2
		/// </summary>
		// Token: 0x17000125 RID: 293
		// (get) Token: 0x0600026D RID: 621 RVA: 0x00004861 File Offset: 0x00002A61
		// (set) Token: 0x0600026E RID: 622 RVA: 0x00004869 File Offset: 0x00002A69
		public string ExchangeRateType { get; set; }

		/// <summary>
		/// 税组合编码
		/// </summary>
		// Token: 0x17000126 RID: 294
		// (get) Token: 0x0600026F RID: 623 RVA: 0x00004872 File Offset: 0x00002A72
		// (set) Token: 0x06000270 RID: 624 RVA: 0x0000487A File Offset: 0x00002A7A
		public string TaxScheduleCode { get; set; }

		// Token: 0x17000127 RID: 295
		// (get) Token: 0x06000271 RID: 625 RVA: 0x00004883 File Offset: 0x00002A83
		// (set) Token: 0x06000272 RID: 626 RVA: 0x0000488B File Offset: 0x00002A8B
		public List<ShipLineRData> ShipLines { get; set; }

		// Token: 0x06000273 RID: 627 RVA: 0x00004894 File Offset: 0x00002A94
		public ShipDTOForIndustryChainData ToISVData()
		{
			ShipDTOForIndustryChainData data = new ShipDTOForIndustryChainData();
			data.DocNo = this.DocNo;
			data.BusinessDate = this.BusinessDate;
			data.ID = this.ID;
			data.DocumentType = new CommonArchiveDataDTOData(this.DocTypeKey, this.DocTypeCode, "");
			data.OrderBy = new CommonArchiveDataDTOData(this.CustomerKey, this.CustomerCode, "");
			data.Seller = new CommonArchiveDataDTOData(-1L, this.SellerCode, "");
			data.SaleDept = new CommonArchiveDataDTOData(-1L, this.SaleDeptCode, "");
			data.TaxSchedule = new CommonArchiveDataDTOData(-1L, this.TaxScheduleCode, "");
			data.ConfirmTerm = new CommonArchiveDataDTOData(-1L, this.ConfirmTermCode, "");
			data.ChangeFieldList = this.ChangeFieldList;
			bool flag = !string.IsNullOrEmpty(this.AC);
			if (flag)
			{
				data.AC = new CommonArchiveDataDTOData();
				data.AC.Code = this.AC;
			}
			bool flag2 = !string.IsNullOrEmpty(this.TC);
			if (flag2)
			{
				data.TC = new CommonArchiveDataDTOData();
				data.TC.Code = this.TC;
			}
			bool flag3 = !string.IsNullOrEmpty(this.ExchangeRateType);
			if (flag3)
			{
				int exchangeRateType;
				bool result = int.TryParse(this.ExchangeRateType, out exchangeRateType);
				bool flag4 = result;
				if (flag4)
				{
					data.ExchangeRateType = exchangeRateType;
				}
			}
			bool flag5 = this.DescFlexField != null;
			if (flag5)
			{
				data.DescFlexField = ToolUtils.ConvertDescFlexFieldToData(this.DescFlexField);
			}
			data.ShipLines = new List<ShipLineDTOForIndustryChainData>();
			foreach (ShipLineRData shipline in this.ShipLines)
			{
				data.ShipLines.Add(shipline.ToISVData());
			}
			return data;
		}

		// Token: 0x06000274 RID: 628 RVA: 0x00004AA4 File Offset: 0x00002CA4
		public void FromISVData(ShipDTOForIndustryChainQueryData data)
		{
			this.DocNo = data.DocNo;
			this.BusinessDate = data.BusinessDate;
			this.ID = data.ID;
			bool flag = data.DocumentType != null;
			if (flag)
			{
				this.DocTypeKey = data.DocumentType.ID;
				this.DocTypeCode = data.DocumentType.Code;
			}
			bool flag2 = data.OrderBy != null;
			if (flag2)
			{
				this.CustomerKey = data.OrderBy.ID;
				this.CustomerCode = data.OrderBy.Code;
			}
			bool flag3 = data.DescFlexField != null;
			if (flag3)
			{
				this.DescFlexField = ToolUtils.ConvertDataToDescFlexField(data.DescFlexField);
			}
			this.ShipLines = new List<ShipLineRData>();
			bool flag4 = data.ShipLines != null;
			if (flag4)
			{
				foreach (ShipLineDTOForIndustryChainQueryData shiplineData in data.ShipLines)
				{
					ShipLineRData shipline = new ShipLineRData();
					shipline.FromISVData(shiplineData);
					this.ShipLines.Add(shipline);
				}
			}
		}
	}
}
